package com.wgb.movie.model.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SeatStatus {


    /**
     * 座位行
     */
    private Integer row;
    /**
     * 座位列
     */
    private Integer column;

    /**
     * 座位状态 0：未售出 1：已售出
     */
    private Integer status;

    public static List<SeatStatus> generateSeats(int rows, int columns) {
        List<SeatStatus> seats = new ArrayList<>();
        for (int i = 0; i < rows; i++) {
            for (int j = 0; j < columns; j++) {
                seats.add(new SeatStatus(i + 1, j + 1, 0)); // 座位行和列从1开始编号，状态默认为0
            }
        }
        return seats;
    }

}
